package puyu.manage.service.task.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import puyu.manage.service.common.config.BaseController;
import puyu.manage.service.common.page.TableDataInfo;
import puyu.manage.service.task.service.TaskService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 任务表(PuyuTTask)表控制层
 *
 * @author makejava
 * @since 2024-06-17 15:08:49
 */
@RestController
@Api(tags = "任务数据处理")
@RequestMapping("/task")
public class TaskController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private TaskService taskService;

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @ApiOperation(value = "样品二维码分页查询")
    @PostMapping(value = "/getTaskList", produces = { "application/json; charset=UTF-8" })
    public TableDataInfo getTaskList(
            @ApiParam(name="params",
                    value="参数集合:pageNum-第几页;pageSize-每页多少条;orderByColumn-排序列;isAsc-正序倒序;taskCode-任务编号",required=true) @RequestParam Map<String,Object> params
    ){
        startPage();//需传pageNum pageSize orderByColumn（排序列 ） isAsc（正序倒序）
        //根据条件分页查询列表
        List<Map<String,Object>> list = taskService.getTaskList(params);
        return getDataTable(list);
    }

}

